package com.service;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public abstract class ApplicationContextService {

    protected static <T> T getApplicationContext(Class<T> cls){
        ApplicationContext applicationContext =
                new ClassPathXmlApplicationContext("applicationContext.xml");
        T object = applicationContext.getBean(cls);
        return object;
    }
}
